<?php
/**
 * Created by PhpStorm.
 * User: pengxu
 * Date: 2017/12/22
 * Time: 9:57
 */

/*Route::get('/', function () {
    //return view('welcome');
});*/


Route::get('mobilemain/index', 'Mobile\IndexController@index')->middleware('mobile.common.wechatShare');
Route::get('mobilemain/show/{id}', 'Mobile\IndexController@index')->middleware('mobile.common.wechatShare');
Route::resource('index', 'HomeController');

Route::group(['prefix' => 'sms'], function () {
    Route::group(['namespace' => 'Common'], function () {
        Route::post('send', 'SmsController@sendCode');
    });
});

Route::group(['namespace' => 'Home'], function () {

    Route::resource('homes', 'HomeController');
    Route::get('/','MainController@index');
    Route::group(['prefix' => 'main'], function () {
        Route::get('index', 'MainController@index');
        Route::get('productlist', 'MainController@productlist');
        Route::get('mortgage', 'MainController@mortgage');
        Route::get('fund', 'MainController@fund');
        Route::get('group', 'MainController@group');
        Route::get('card', 'MainController@card');
        Route::get('evaluate', 'MainController@evaluate');
        Route::post('evaluate', 'MainController@evaluate');
        Route::get("aboutus","MainController@aboutus");
        Route::get("service","MainController@service");
        Route::get("newmanual","MainController@newmanual");
        Route::get("contactus","MainController@contactus");
        Route::get("serviceterms","MainController@serviceterms");
        Route::get("tools","MainController@tools");
        Route::post("region","MainController@region");

        //Route::group(['namespace' => 'Home'/*'middleware' => ['wechat.oauth']*/], function () {
            //Route::get('/home', 'HomeController@index')->name('home.index');
            //Route::get('/show', 'HomeController@show')->name('home.show');
            //Route::resource('home', 'HomeController');
            /*Route::get('index', function (\Illuminate\Http\Request $request) {
                return $request->all();
                $user = session('wechat.oauth_user'); // 拿到授权用户资料
                $original = $user->original;
                return $original['nickname'];
            });*/
       // });
    });

    Route::group(['prefix' => 'apply'], function () {
        Route::post('fastapply', 'ApplyController@FastApply');
        Route::get('cardstepone', 'ApplyController@cardstepone');
        Route::any("cardsteptwo","Apply@cardsteptwo");
        Route::any("cardstepthree","Apply@cardstepthree");

        Route::any("onestep","ApplyController@onestep");
        Route::any("twostep","ApplyController@twostep");
        Route::any("threestep","ApplyController@threestep");
        Route::any("fourstep","ApplyController@fourstep");



    });


    Route::group(['prefix' => 'user'], function () {
        Route::any("login","UserController@login");
        Route::get("logout","UserController@logout");
        Route::post("quit","UserController@quit");
        Route::post("quit","UserController@quit");
        Route::any("register","UserController@register");
        Route::any("ishavemobile","UserController@ishavemobile");
    });
});

